<template>
	<view class="my-fixed" :style="{paddingTop:pTop+'px'}">
		<view class="cu-bar bg-white">
			<view class="action">
				<text class="cuIcon-locationfill text-gray"></text> 
				{{city}}
			</view>
			<view class="content text-bold">
				MCAKE
			</view>
			<!-- #ifndef MP-WEIXIN -->
			<view class="action text-grey">
				<text class="cuIcon-search margin-right"></text>
				<u-line color="#2979ff" direction="col" length="15" margin="5px"></u-line>
				<text class="cuIcon-sort"></text>
			</view>
			<!-- #endif -->
		</view>
	</view>
</template>

<script>
	import {mapState} from 'vuex'
	export default {
		name:"nav-custom",
		data() {
			return {
				pTop:0
			};
		},
		computed: {
			// location(){
			// 	return this.$store.state.location.city
			// },
			...mapState({
				city:state=>state.location.city
			})
		},
		created() {
			uni.getSystemInfo({
				success: (res) => {
					console.log(res);
					let {statusBarHeight} = res //手机状态栏高度
					this.pTop = statusBarHeight
				}
			})
		}
	}
</script>

<style lang="scss">
.cu-bar.fixed.bg-white + .cont{
	margin-top: 120upx;
} 
.my-fixed{
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	z-index: 3;
}
</style>